<div id="page-content" xmlns:c="http://www.w3.org/1999/html">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title" style="text-align:center;">
                    #(o?o.paperTitle:'暂无问卷信息')
                </h3>
            </div>
            <!--<form id="editForm" style="text-align: center;height: 720px;" class="panel-body form-horizontal form-padding bv-form" novalidate="novalidate">
                <button type="submit" class="bv-hidden-submit" style="display: none; width: 0px; height: 0px;"></button>
                <input type="hidden" id="id" name="paper.id" class="form-control" value="#(o.id)">
                #for(x: paperItems)
                <div class="form-group" style="display: flex;flex-direction: row;align-items:center;">
                    <div class="form-name" style="margin: 10px;width: 20%;">#(x.name)</div>
                    <div class="form-children" style="display: flex; flex-direction: column;width: 100%;">
                        #if(x.children)
                        #for(s:x.children)
                        <p style="margin: 0px">
                            <span class="col-md-3">#(s.name)</span>
                            <span>
                              <input id="que_A#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                     value="20" #if(s&&s.value=='20') checked #end >
                              <label for="que_A#(s.name)">20</label>
                              <input id="que_B#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                     value="40" #if(s&&s.value=='40') checked #end>
                              <label for="que_B#(s.name)">40 </label>
                              <input id="que_C#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                     value="60" #if(s&&s.value=='60') checked #end>
                              <label for="que_C#(s.name)">60 </label>
                              <input id="que_D#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                     value="80" #if(s&&s.value=='80') checked #end>
                              <label for="que_D#(s.name)">80 </label>
                              <input id="que_E#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                     value="100" #if(s&&s.value=='100') checked #end>
                              <label for="que_E#(s.name)">100 </label>
                            </span>
                        </p>
                        #end
                        #end
                    </div>
                </div>
                #end
            </form>-->
            <form id="editForm" style="text-align: center;height: 720px;" class="panel-body form-horizontal form-padding bv-form" novalidate="novalidate">
                <input type="hidden" id="id" name="paper.id" class="form-control" value="#(o.id)">
                <table class="hover-table" align="center">
                    <th>一级指标</th><th>二级指标</th><th>评价分数</th>
                    #for(x:paperItems)
                        <tr>
                            <td class="title" rowspan="x.children.size()">#(x.name)</td>
                            #if(x.children)
                                <td>
                                    #for(s:x.children)
                                        <p>
                                            <span>#(s.name)</span>
                                        </p>
                                    #end
                                </td>
                                <td>
                                    #for(s:x.children)
                                    <p>
                                        <span>
                                          <input id="que_A#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                                 value="20" #if(s&&s.value=='20') checked #end >
                                          <label for="que_A#(s.name)">20</label>
                                          <input id="que_B#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                                 value="40" #if(s&&s.value=='40') checked #end>
                                          <label for="que_B#(s.name)">40 </label>
                                          <input id="que_C#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                                 value="60" #if(s&&s.value=='60') checked #end>
                                          <label for="que_C#(s.name)">60 </label>
                                          <input id="que_D#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                                 value="80" #if(s&&s.value=='80') checked #end>
                                          <label for="que_D#(s.name)">80 </label>
                                          <input id="que_E#(s.name)" class="magic-radio" type="radio" name="que#(s.base_id)"
                                                 value="100" #if(s&&s.value=='100') checked #end>
                                          <label for="que_E#(s.name)">100 </label>
                                        </span>
                                    </p>
                                    #end
                                </td>
                            #end
                        </tr>
                    #end
                </table>
            </form>
            <div class="panel-footer">
                <div class="row">
                    <div class="col-sm-8 col-sm-offset-5">
                        <button class="btn btn-info" type="button" onclick="goBack1()">取消</button>
                        <button class="btn btn-warning" type="button" onclick="reset1()" #if(view=='detail') disabled #end>重置</button>
                        <button class="btn btn-mint" type="button" onclick="save()">保存并提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    .hover-table{
        min-height: 520px;
        width: 75%;
    }
    .hover-table tr{
        border: 1px solid #73b4da;
    }

    .hover-table td{
        border: 1px solid #73b4da;
    }
    .hover-table th{
        border: 1px solid #73b4da;
        text-align: center;
    }
    .title{
        font-size: 15px;
        font-weight: bold;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {

    });

    function reset1(){
        $('input:radio').attr('checked',false);
    }

    function goBack1() {
        pointLion.confimMsg("该页面填写记录为保存，您是否要返回上一页 ?<br/> 点击确认进行返回 , 点击取消取消该操作", null, function () {
            doPjax(ctx + '/admin/paper/showPaper');//跳转到列表页
        })
    }

    function save() {
        var data = common_ajax.ajaxFunc("/admin/paper/saveUserPaper", {formData:$('#editForm').serialize()}, "json", null);
        if (data.success) {
            pointLion.alertMsg("保存成功!", "success", "small", function () {
                doPjax(ctx + '/admin/paper/showPaper');
            });
        } else {
            pointLion.alertMsg(data.message, "danger", "small", null);
        }
    }
</script>